﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wwtfly.Utility;
namespace Wwtfly.BBS.ForeApplication.WebForm
{
    public partial class MoneyAdd : System.Web.UI.Page
    {
        public string Balance;
        public string UserName;
        public string BankName;
        public double Money = 0;
        public double RealPayMoney = 0;
        public long BuyID = 0;
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            string strMoney = this.PayMoney.Value;
            if (strMoney.AsInt(0) < 1)
            {
                Response.Write("<script>alert('请输入正确充值金额！且充值至少1元!');</script>");
            }
            else
            {
                this.lbPayMoney.Text = strMoney;
                Money = strMoney.AsInt(1);
                if (radyeepay.Checked)
                {
                    BankName = "yeepay";
                    hdBankCode.Value = "0";
                }
                else if (radICBCB2C.Checked)
                {
                    BankName = "hsyh";
                    hdBankCode.Value = "ICBCB2C";
                }
                else if (radGDB.Checked)
                {
                    BankName = "gdfzyh";
                    hdBankCode.Value = "GDB";
                }
                else if (radGDYH.Checked)
                {
                    BankName = "gdyh";
                    hdBankCode.Value = "CEBBANK";
                }
                else if (radCOMM.Checked)
                {
                    BankName = "jtyh";
                    hdBankCode.Value = "COMM";
                }
                else if (radABC.Checked)
                {
                    BankName = "nyyh";
                    hdBankCode.Value = "ABC";
                }
                else if (radSPDB.Checked)
                {
                    BankName = "shpd";
                    hdBankCode.Value = "SPDB";
                }
                else if (radSDB.Checked)
                {
                    BankName = "szfzyh";
                    hdBankCode.Value = "SDB";
                }
                else if (radCIB.Checked)
                {
                    BankName = "xyyh";
                    hdBankCode.Value = "CIB";
                }
                else if (radCMBC.Checked)
                {
                    BankName = "zgms";
                    hdBankCode.Value = "CMBC";
                }
                else if (radBOCB2C.Checked)
                {
                    BankName = "zgyh";
                    hdBankCode.Value = "BOCB2C";
                }
                else if (radCMB.Checked)
                {
                    BankName = "zsyhj";
                    hdBankCode.Value = "CMB";
                }
                else if (radBCCBEB.Checked)
                {
                    BankName = "bjyh";
                    hdBankCode.Value = "1032";
                }
                else if (radCCB.Checked)
                {
                    BankName = "jsyh";
                    hdBankCode.Value = "1003";
                }
                if (hdBankCode.Value == "")
                {
                    Response.Write("<script>alert('请选择银行，谢谢!');</script>");
                    return;
                }
                else
                {
                    
                    hlOK.NavigateUrl = "YeePay/Send.aspx?PayMoney=" + Money + "&bankPay=" + this.hdBankCode.Value + "&BuyID=" + BuyID.ToString();
                    pnlFirst.Visible = false;
                    pnlSecond.Visible = true;
                }

            }
        }
        protected void lbReturn_Click(object sender, EventArgs e)
        {
            pnlFirst.Visible = true;
            pnlSecond.Visible = false;
        }
    }
}